<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>项目管理系统</title>
    <link href="<%=request.getContextPath()%>/css/login.css" type="text/css" rel="stylesheet" />
    <script src="<%=request.getContextPath()%>/js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script>
        $(function()
        {
            windowSize();
            scrollBanner();
        })
        $(window).resize(function()
        {
            windowSize();
        });
        function windowSize()
        {
            if($(window).height() < 640)
            {
                $('#footer').css('position','static');
            }
            else
            {
                $('#footer').css('position','fixed');
            }
        }

        //轮播
        var iNow = 1;
        var scrollTimer = null;
        function scrollBanner()
        {
            clearInterval(scrollTimer);
            scrollTimer = setInterval(auto,4000);
            function auto()
            {
                if(iNow == $('.banner li').length)
                {
                    iNow = 0;
                }
                scrollRun(iNow);
                iNow ++;
            }

            function scrollRun(index)
            {
                $('.banner li').fadeOut(1000);
                $('.banner li').eq(index).fadeIn(1000);
            }
        }
    </script>

    <script type="text/javascript">

        $(function (){
            //对验证码的文本框绑定失去焦点事件
            $("#verificationCode").keyup(function (){

                var code = $("#verificationCode").val();

                if(code == 1328){
                    $("#message").html("<font color=\"green\" size=\"3\">验证码正确</font>");
                }else{
                    $("#message").html("<font color=\"red\" size=\"3\">验证码有误</font>");
                }

            })

            $("#loginButton").click(function (){
                //获取验证码信息
                var codeInfo = $("#message>font").html()

                if(codeInfo == "验证码正确"){
                    $("#loginForm").submit();
                }else{
                    $("#verificationCode").focus();
                }
            })
        })

    </script>
</head>
<body>
    <div id="header">
        <a class="fl" href="#"><img width="226" height="50" src="images/logo.jpg" /></a>
    </div>

    <div id="wrap">
        <div class="fl">
            <ul class="banner">
                <li class="active"><img src="images/b1.png" /></li>
                <li><img src="images/b2.png" /></li>
                <li><img src="images/b3.png" /></li>
            </ul>
        </div>
        <form id="loginForm" action="<%=request.getContextPath()%>/login" method="post">
            <div class="login fr">
                <div class="login_1"><img src="images/login_box_logo.png" />种子项目管理系统</div>
                <div class="login_2">
                    <div class="login_3">
                        <input class="username" type="text" placeholder="用户名" name="username" required/>
                        <input type="password" placeholder="密码" name="password" required/>
                        <input class="yzm fl" type="text" placeholder="验证码" id="verificationCode"/>
                        <div class="yzm_img fl"><img src="images/yzm.png" /></div>
                        <a class="hyz fl" href="#">换一张</a>
                        <div class="clear"></div>
                        <div class="login_4">
                            <label>
                                <input type="checkbox" />
                                <span>记住账户</span>
                            </label>
                            <a href="#" class="fr">忘记密码</a>
                        </div>
                        <div class="login_4">
                            <span align="center" id="message"><font color="red" size="3">${loginInfo}</font></span>
                        </div>
                    </div>
                    <!-- <a href="html/index.html" class="login_5">登&nbsp;&nbsp;&nbsp;&nbsp;录</a> -->
                </div>
                <a href="#" class="login_7" id="loginButton">登　　录</a>
            </div>
        </form>
    </div>

    <div id="footer">
        <div class="footer_2">版权所有：欧辰科技有限公司</div>
    </div>
</body>
</html>
